// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

//-------------MAIN---------------
thread 'PET' 

:PET_1
wait 1 
if 
   Player.Defined($PLAYER_CHAR)
else_jump @PET_1
if and
   NOT Actor.Dead($PLAYER_ACTOR)
$ONMISSION == 0
else_jump @PET_1
if
00A4:   actor $PLAYER_ACTOR sphere 0 in_cube_cornerA 2490.0 -1690.0 1014.0 cornerB 2502.0 -1713.0 1030.0 
else_jump @PET_1
023C: load_special_actor 'NAME_OF_PET' as 1 // models 290-299 
038B: load_requested_models 
if
   Model.Available(#SPECIAL01)
else_jump @PET_1
060A: create_decision_maker_type 0 store_to $RANG_GROUP // decision\allowed\m_.ped files 
1@ = Actor.Create(Mission1, #SPECIAL01, 2496.0, -1700.0, 1014.0)
0446: set_actor 1@ dismemberment_possible 0 
04D8: set_actor 1@ drowns_in_water 0 
03FE: set_actor 1@ money 0
Actor.SetImmunities(1@, 1, 1, 1, 1, 1)
060B: set_actor 1@ decision_maker_to $RANG_GROUP
077A: set_actor 1@ acquaintance 1 to_actors_pedtype 0 // see ped.dat 
Actor.RemoveReferences(1@)
$PET_FOLLOW = 0
jump @PET_2

:PET_2
wait 1
if
NOT $PET_FOLLOW == 1
if or
00A4:   actor $PLAYER_ACTOR sphere 0 in_cube_cornerA 2494.5 -1692.0 1014.0 cornerB 2497.0 -1693.5 1015.0
00A4:   actor $PLAYER_ACTOR sphere 0 in_cube_cornerA 2490.5 -1693.5 1014.0 cornerB 2498.0 -1704.6 1015.0 
00A4:   actor $PLAYER_ACTOR sphere 0 in_cube_cornerA 2492.0 -1704.6 1014.0 cornerB 2501.0 -1712.5 1015.0 
else_jump @PET_3
wait 1
0850: AS_actor 1@ follow_actor $PLAYER_ACTOR 
$PET_FOLLOW == 1
jump @PET_3

:PET_3
wait 0
if or
Actor.Dead($PLAYER_ACTOR)
80A4:   not actor $PLAYER_ACTOR sphere 0 in_cube_cornerA 2490.0 -1690.0 1014.0 cornerB 2502.0 -1713.0 1030.0 
$ONMISSION == 1
else_jump @PET_4
wait 1
Actor.DestroyInstantly(1@)
Model.Destroy(#SPECIAL01)
jump @PET_1

:PET_4
if
80A4:   not actor $PLAYER_ACTOR sphere 0 in_cube_cornerA 2494.5 -1692.0 1014.0 cornerB 2497.0 -1693.5 1015.0 
else_jump @PET_2
if
80A4:   not actor $PLAYER_ACTOR sphere 0 in_cube_cornerA 2490.5 -1693.5 1014.0 cornerB 2498.0 -1704.6 1015.0 
else_jump @PET_2
if
80A4:   not actor $PLAYER_ACTOR sphere 0 in_cube_cornerA 2492.0 -1704.6 1014.0 cornerB 2501.0 -1712.5 1015.0 
else_jump @PET_2
05D3: AS_actor 1@ goto_point 2496.0 -1700.0 1014.0 mode 4 -1 ms // versionA 
$PET_FOLLOW = 0
jump @PET_2